import {Loading} from 'element-ui';

let loadingInstance = null;

const startLoading = (loadingTxt = '正在操作...') => {
  const options = {
    fullscreen: true, body: true, text: loadingTxt
  };
  loadingInstance = Loading.service(options);
}

const endLoading = () => {
  loadingInstance && loadingInstance.close()
}

export {startLoading, endLoading}
